package com.lmt;

import feign.Contract;
import feign.codec.Decoder;
import feign.codec.Encoder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.support.SpringMvcContract;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@EnableDiscoveryClient
//@EnableFeignClients
@SpringBootApplication
public class ConsumerFeignManualApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerFeignManualApplication.class, args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @Bean
    public Decoder decoder() {
        return new GsonDecoder();
    }

    @Bean
    public Encoder encoder() {
        return new Encoder.Default();
    }

    @Bean
    public Contract contract() {
        return new SpringMvcContract();
    }
}
